function writeToMAT(data, fileName)

failIfFalse(isvector(data), 'data should be a nX1 vector');
failIfFalse(ischar(fileName), 'fileName should be a string');

data = data';

save(fileName, 'data', '-v6');